package com.rpp.enums;

public enum NodeType {

    SELECT(1, "select"),
    INSERT(2, "insert"),
    UPDATE(3, "update"),
    DELETE(4, "delete");

    NodeType(int type, String des) {
        this.type = type;
        this.des = des;
    }

    private int type;
    private String des;

    public int getType() {
        return type;
    }

    public String getDes() {
        return des;
    }

    public static NodeType parse(String des) {
        for (NodeType value : NodeType.values()) {
            if (value.getDes().equals(des)) {
                return value;
            }
        }
        return null;
    }
}
